package com.retirement.enroll.controller;

import com.retirement.common.core.domain.AjaxResult;
import com.retirement.enroll.vo.EnrollVo;
import com.retirement.enroll.domain.OldEnroll;
import com.retirement.enroll.service.IOldEnrollService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lijy
 * @since 2024-01-02
 */
@Api(value = "活动报名管理", tags = "活动报名管理")
@RequiredArgsConstructor
@RestController
@RequestMapping("/enroll")
public class OldEnrollController {

    private final IOldEnrollService iOldEnrollService;

    @PostMapping
    @ApiOperation(value = "新增活动报名")
    public AjaxResult addEnroll(@RequestBody OldEnroll dto){
        return AjaxResult.success(iOldEnrollService.addEnroll(dto));
    }

    @GetMapping("/information/{id}")
    @ApiOperation(value = "用户查询报名信息")
    public List<EnrollVo> listEnroll(@PathVariable("id") String id){
        return iOldEnrollService.listEnroll(id);
    }



}
